import Vue from 'vue'
import VueRouter from 'vue-router'
import IndexView from "@/components/layout/IndexView";

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',//路由地址
        name: 'home',
        component: IndexView,
        children: [
            {
                path: '/user',
                name: 'User',
                component: () => import('@/views/UserView')
            },
            {
                path: '/role',
                name: 'Role',
                component: () => import('@/views/RoleView')
            }
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
